<link rel="stylesheet" href="/assets/home/css/index.css" />
<link rel="stylesheet" href="/assets/home/css/swiper-bundle.css">
<script src="/assets/home/js/swiper-bundle.min.js"></script>

<!-- 轮播图 -->
{if condition="$top"}
<div class="mui-content">
    <div class="swiper mySwiper">
        <div class="swiper-wrapper">
            {foreach $top as $item}
            <div class="swiper-slide">
                <a href="{:url('home/subject/info', ['subid' => $item['id']])}">
                    <img src="{$item.thumbs}">
                    <p class="mui-slider-title">{$item.title}</p>
                </a>
            </div>
            {/foreach}
        </div>
        <div class="swiper-pagination" style="text-align: right;"></div>
    </div>
</div>
{/if}

<!-- 菜单 -->
<div class="menulist">
    <div class="item">
        <a href="live.html">
            <img src="/assets/home/images/live.png" alt="">
            <div class="name">课程直播</div>
        </a>
    </div>

    <div class="item">
        <a href="comment_list.html">
            <img src="/assets/home/images/comment.png" alt="">
            <div class="name">学员评论</div>
        </a>
    </div>

    <div class="item">
        <a href="ranking.html">
            <img src="/assets/home/images/ranking.png" alt="">
            <div class="name">课程榜单</div>
        </a>
    </div>

    <div class="item">
        <a href="{:url('home/coupon/index')}">
            <img src="/assets/home/images/coupon.png" />
            <div class="name">领取优惠</div>
        </a>
    </div>
</div>

<!-- 精选课程 -->
{if condition="$subject"}
<div class="list">
    <div class="title">精选课程</div>
    <ul>
        {foreach $subject as $item}
        <li>
            <a href="{:url('home/subject/info', ['subid' => $item['id']])}">
                <div class="imgs">
                    <img class="mui-media-object" src="{$item.thumbs}">
                </div>
                <div class="mui-media-body">{$item.title}</div>
                <div class="info">
                    <div class="price">￥{$item.price}</div>
                    <div class="like">
                        {$item.likes_text}
                        <img src="/assets/home/images/thumbs-up.png" alt="">
                    </div>
                </div>
            </a>
        </li>
        {/foreach}
    </ul>
</div>
{/if}

<!-- 精选名师 -->
{if condition="$teacher"}
<div class="list teacher">
    <div class="title">精选名师</div>
    <ul>
        {foreach $teacher as $item}
        <li>
            <a href="{:url('home/teacher/info', ['teacherid'=>$item['id']])}">
                <div class="imgs">
                    <img class="mui-media-object" src="{$item.avatar_text}">
                </div>
                <div class="mui-media-body">{$item.name}</div>
                <div class="info">
                    <div class="num">课程数量：{$item.count_text}个</div>
                    <div class="like">
                        {$item.follows_text}
                        <img src="/assets/home/images/like.png" alt="">
                    </div>
                </div>
            </a>
        </li>
        {/foreach}
    </ul>
</div>
{/if}

<!-- 底部 -->
{include file="common/footer" /}


<script>
    var swiper = new Swiper(".mySwiper", {
        pagination: {
            el: ".swiper-pagination",
        },
    });
</script>
